package nl.hu.modellingengine.grid.client.activity;

import nl.hu.modellingengine.client.ClientFactory;
import nl.hu.modellingengine.grid.client.GridFactory;
import nl.hu.modellingengine.ribbon.client.places.ElementPositionChangePlace;

import com.google.gwt.activity.shared.Activity;
import com.google.gwt.activity.shared.ActivityMapper;
import com.google.gwt.place.shared.Place;

public class GridActivityMapper implements ActivityMapper {
	
	private ClientFactory clientFactory;
	private GridFactory gridFactory;
	
	public GridActivityMapper(ClientFactory clientFactory, GridFactory gridFactory){
		this.clientFactory = clientFactory;
		this.gridFactory = gridFactory;
	}

	@Override
	public Activity getActivity(Place place) {
		if(place instanceof ElementPositionChangePlace){
			return new GridElementPositionChangeActivity((ElementPositionChangePlace)place,clientFactory,gridFactory);
		}
		return null;
	}

}
